#!/bin/sh
# Copyright (c) 2010, bkil.hu
# This program is free software and can be distributed under the terms of
# the GNU General Public License v2,
# see COPYING for detailed licensing terms.

# created on 2010-10-30 13:18

getchan() {
 grep '<option name="Channel" value="' ~/.tvtime/tvtime.xml |
 sed 's~^.*<option name="Channel" value="\([^"]*\)"/>.*~\1~'
}

getfreq(){
 local CH=$1
 grep "<station [^>]*\<position=\"$CH\""  ~/.tvtime/stationlist.xml |
 sed 's~^.*\<channel="\([1-9][0-9]*\.[0-9][0-9]*\)MHz".*$~\1~'
}

getfreq `getchan`

